#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(){
    int n,m;
    cin>>n>>m;
    vector<int> a(n),c(n);
    for(int i=0;i<n;i++)cin>>a[i];
    c[0]=a[0];
    for(int i=1;i<n;i++)c[i]=min(a[i],c[i-1]);
    for(int i=0;i<m;i++){
        int b;
        cin>>b;
        auto it=lower_bound(c.begin(),c.end(),b,greater<int>());
        if(it-c.begin()<n)cout<<it-c.begin()+1<<endl;
        else cout<<"-1"<<endl;
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    solve();
    

    return 0;
}